package com.lovejes.jesacl.dao.impl;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Session;

import com.lovejes.dao.impl.JesDao;
import com.lovejes.ex.LoveJesException;
import com.lovejes.jesacl.domain.Aclorguser;
/**
 * create sequence SEQ_ACLORGID INCREMENT BY 1 start with 1 maxvalue 9999999999 NOCACHE NOCYCLE; 
   TODO
   date:2013-3-13
   author:hyyy
 */
public class AclorgDao extends JesDao{
	Log logger = LogFactory.getLog(AclorgDao.class);

	/**
	 * 
	 * @param s
	 * @param usid
	 * @param oid
	 * @throws LoveJesException
	   void
	   date:2013-3-1
	   author:hyyy
	 */
	public void saveAclorguser(Session s,String usid,String oid) throws LoveJesException{
		delete(s, "Aclorguser", "Usid='"+usid+"'");
		Aclorguser oAclorguser = new Aclorguser();
		oAclorguser.setUsid(usid);
		oAclorguser.setOid(oid);
		try {
			save(s, oAclorguser);
		} catch (Exception e) {
			logger.error(e);
			logger.error(e.getCause());
			throw new LoveJesException(e);
		}
	}
	

}
